import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TaskShowTargetInfo } from "../model/TaskShowTargetInfo";
import { StringHelper } from "../../../com/gengine/utils/StringHelper";
type int = number;
//class TaskShowConfig
    
    export  class TaskShowConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (TaskShowConfig._instance != null) 
            {
                throw new Error("TargetConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_show_talk.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=0;
            var loc6=arg1;
            for(loc4 of loc6) 
            {
                loc1 = new TaskShowTargetInfo();
                loc1.id = loc4.id;
                loc2 = StringHelper.getString(loc4.str);
                loc3 = loc2.split("#");
                loc1.showStr = StringHelper.getString(loc3[0]);
                loc1.showTime = loc3[1];
                loc1.poetry = StringHelper.getString(loc4.poetry);
                this._map[loc1.id] = loc1;
            }
            return;
        }

        public getShowTalkById(arg1: int): TaskShowTargetInfo
        {
            return this._map[arg1];
        }

        public static get instance(): TaskShowConfig
        {
            if (TaskShowConfig._instance == null) 
            {
                TaskShowConfig._instance = new TaskShowConfig();
            }
            return TaskShowConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: TaskShowConfig;
    }
